---
description: "Reference for Nitric's Node.js library - Determine if a file exists in a bucket."
---

# Node.js - bucket.file.exists()

<Note>
  This is reference documentation for the Nitric Node.js SDK. To learn about
  Buckets and Storage in Nitric start with the [Storage docs](/storage).
</Note>

Determine if a file exists in a bucket.

```javascript
import { bucket } from '@nitric/sdk'

const assets = bucket('assets').allow('read')

const exists = await assets.file('images/logo.png').exists()
```

## Examples

### Determine if a file exists

```javascript
import { bucket } from '@nitric/sdk'

const assets = bucket('assets').allow('read')

const exists = await assets.file('images/logo.png').exists()
```
